<?php
/**
 * wp-foundation dynamic-banner.php
 */
?>
<?php // Banner Footer scripts
function foundation_banner_footer_files(){ ?>
    <?php if (is_home() || is_front_page()){ 
		global $options;
foreach ($options as $value) {
if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); }
}
	?>
    <script type="text/javascript">
    $(document).ready(function() {	
		//home page splash transition
		if ($('#s1').length){
		$('#s1').after('<div id="nav">').cycle({ 
			fx:      '<?php echo $fd_home_banner_effect ?>', 
			speed:   500,
			pause:   1,
			timeout: 7000, 
			pager:   '#nav'
		});
		}
		// END: home page splash transition
	});
	</script>
    
<?php }	}
add_action('wp_footer', 'foundation_banner_footer_files', 9);
// END :Footer scripts

// Foundation / cycle splash
function foundation_home_splash(){
	global $options;
foreach ($options as $value) {
if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); }
}
if ($fd_enable_home_banner == 'Enable'){
if (is_home() || is_front_page()){
	$splash = '';
	$splash .= '<div id="splash"><div id="s1" class="splashpics">';
	//splash 1
	$splash .= '<a href="#" class="splash1"><img src="';
	$splash .= $fd_image1_url;
	$splash .= '" alt="';
	$splash .= $fd_image1_alt;
	$splash .= '" title="';
	$splash .= $fd_image1_title;
	$splash .= '" width="';
	$splash .= $fd_image1_width;
	$splash .= '" height="';
	$splash .= $fd_image1_height;
	$splash .= '" /></a>';
	//splash 2
	if ($fd_image2_active == 'Enable'){
	$splash .= '<a href="#" class="splash2"><img src="';
	$splash .= $fd_image2_url;
	$splash .= '" alt="';
	$splash .= $fd_image2_alt;
	$splash .= '" title="';
	$splash .= $fd_image2_title;
	$splash .= '" width="';
	$splash .= $fd_image2_width;
	$splash .= '" height="';
	$splash .= $fd_image2_height;
	$splash .= '" /></a>';
	}
	//splash 3
	if ($fd_image3_active == 'Enable'){
	$splash .= '<a href="#" class="splash3"><img src="';
	$splash .= $fd_image3_url;
	$splash .= '" alt="';
	$splash .= $fd_image3_alt;
	$splash .= '" title="';
	$splash .= $fd_image3_title;
	$splash .= '" width="';
	$splash .= $fd_image3_width;
	$splash .= '" height="';
	$splash .= $fd_image3_height;
	$splash .= '" /></a>';
	}
	
	$splash .= '</div></div>';
	
	echo apply_filters('foundation_home_splash', $splash);
}
}
}

// END: Foundation / cycle splash ?>